﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Parentmasterpage.master" CodeBehind="CruisesInTheFuture.aspx.vb" Inherits="WebApplicationcruises.CruisesInTheFuture" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style12
        {
            width: 100%;
        }
        .style13
        {
            height: 32px;
        }
        .style14
        {
            text-align: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style12" style="border: thin ridge #589BB6">
        <tr>
            <td style="border: thin solid #589BB6">
                <b>Announcement</b></td>
        </tr>
        <tr>
            <td style="border: thin solid #589BB6">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" 
                    CellPadding="4" DataKeyNames="AId" DataSourceID="SqlDataSource1" 
                    GridLines="Horizontal" style="margin-top: 0px" Width="855px">
                    <Columns>
                        <asp:BoundField DataField="Adate" HeaderText="Adate" SortExpression="Adate" />
                        <asp:BoundField DataField="Atime" HeaderText="Atime" SortExpression="Atime" />
                        <asp:BoundField DataField="ACournty" HeaderText="ACournty" 
                            SortExpression="ACournty" />
                        <asp:BoundField DataField="ACity" HeaderText="ACity" SortExpression="ACity" />
                        <asp:BoundField DataField="Uname" HeaderText="Uname" SortExpression="Uname" />
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#333333" />
                    <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="White" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F7F7F7" />
                    <SortedAscendingHeaderStyle BackColor="#487575" />
                    <SortedDescendingCellStyle BackColor="#E5E5E5" />
                    <SortedDescendingHeaderStyle BackColor="#275353" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style="border: thin solid #589BB6">
                <b>Add new Announcement</b></td>
        </tr>
        <tr>
            <td class="style13" style="border: thin solid #589BB6">
                <asp:FormView ID="FormView1" runat="server" DataKeyNames="AId" 
                    DataSourceID="SqlDataSource1" DefaultMode="Insert">
                    <EditItemTemplate>
                        AId:
                        <asp:Label ID="AIdLabel1" runat="server" Text='<%# Eval("AId") %>' />
                        <br />
                        Adate:
                        <asp:TextBox ID="AdateTextBox" runat="server" Text='<%# Bind("Adate") %>' />
                        <br />
                        Atime:
                        <asp:TextBox ID="AtimeTextBox" runat="server" Text='<%# Bind("Atime") %>' />
                        <br />
                        ACournty:
                        <asp:TextBox ID="ACourntyTextBox" runat="server" 
                            Text='<%# Bind("ACournty") %>' />
                        <br />
                        ACity:
                        <asp:TextBox ID="ACityTextBox" runat="server" Text='<%# Bind("ACity") %>' />
                        <br />
                        UId:
                        <asp:TextBox ID="UIdTextBox" runat="server" Text='<%# Bind("UId") %>' />
                        <br />
                        <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update" />
                        &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <table class="style12">
                            <tr>
                                <td class="style14">
                                    date:
                                </td>
                                <td>
                                    <asp:TextBox ID="AdateTextBox" runat="server" Text='<%# Bind("Adate") %>' />
                                    <asp:CalendarExtender ID="AdateTextBox_CalendarExtender" runat="server" 
                                        TargetControlID="AdateTextBox">
                                    </asp:CalendarExtender>
                                </td>
                            </tr>
                            <tr>
                                <td class="style14">
                                    time:
                                </td>
                                <td>





                                    <asp:TextBox ID="AtimeTextBox" runat="server" Text='<%# Bind("Atime") %>' />
                                    <asp:MaskedEditExtender ID="AtimeTextBox_MaskedEditExtender" runat="server" 
                                        TargetControlID="AtimeTextBox" Mask="99:99"  >
                                    </asp:MaskedEditExtender>




                                </td>
                            </tr>
                            <tr>
                                <td class="style14">
                                    Cournty:
                                </td>
                                <td>
                                    <asp:TextBox ID="ACourntyTextBox" runat="server" 
                                        Text='<%# Bind("ACournty") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style14">
                                    City:
                                </td>
                                <td>
                                    <asp:TextBox ID="ACityTextBox" runat="server" Text='<%# Bind("ACity") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                        CommandName="Insert" Text="Save" />
                                </td>
                            </tr>
                        </table>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        AId:
                        <asp:Label ID="AIdLabel" runat="server" Text='<%# Eval("AId") %>' />
                        <br />
                        Adate:
                        <asp:Label ID="AdateLabel" runat="server" Text='<%# Bind("Adate") %>' />
                        <br />
                        Atime:
                        <asp:Label ID="AtimeLabel" runat="server" Text='<%# Bind("Atime") %>' />
                        <br />
                        ACournty:
                        <asp:Label ID="ACourntyLabel" runat="server" Text='<%# Bind("ACournty") %>' />
                        <br />
                        ACity:
                        <asp:Label ID="ACityLabel" runat="server" Text='<%# Bind("ACity") %>' />
                        <br />
                        UId:
                        <asp:Label ID="UIdLabel" runat="server" Text='<%# Bind("UId") %>' />
                        <br />
                        <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit" />
                        &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Delete" />
                        &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                            CommandName="New" Text="New" />
                    </ItemTemplate>
                </asp:FormView>
            </td>
        </tr>
        <tr>
            <td style="border: thin solid #589BB6">
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionStringDB %>" 
                    DeleteCommand="DELETE FROM [Announcements] WHERE [AId] = ?" 
                    InsertCommand="INSERT INTO [Announcements] ( [Adate], [Atime], [ACournty], [ACity], [UId]) VALUES ( ?, ?, ?, ?, ?)" 
                    ProviderName="<%$ ConnectionStrings:ConnectionStringDB.ProviderName %>" 
                    SelectCommand="SELECT Announcements.AId, Announcements.Adate, Announcements.Atime, Announcements.ACournty, Announcements.ACity, Announcements.UId, Users.Uname FROM (Announcements INNER JOIN Users ON Announcements.UId = Users.UId)" 
                    
                    UpdateCommand="UPDATE [Announcements] SET [Adate] = ?, [Atime] = ?, [ACournty] = ?, [ACity] = ?, [UId] = ? WHERE [AId] = ?">
                    <DeleteParameters>
                        <asp:Parameter Name="AId" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Adate" Type="String" />
                        <asp:Parameter Name="Atime" Type="String" />
                        <asp:Parameter Name="ACournty" Type="String" />
                        <asp:Parameter Name="ACity" Type="String" />
                        <asp:SessionParameter Name="UId" SessionField="UserId" Type="Int32" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Adate" Type="String" />
                        <asp:Parameter Name="Atime" Type="String" />
                        <asp:Parameter Name="ACournty" Type="String" />
                        <asp:Parameter Name="ACity" Type="String" />
                        <asp:Parameter Name="UId" Type="Int32" />
                        <asp:Parameter Name="AId" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
</asp:Content>
